package cn.teleware.config;

import jcifs.smb.NtlmPasswordAuthentication;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author :hongsw
 * @date :2020-11-19-20:15
 */
@Configuration
public class SambaConfig {
    /**
     * 共享文件夹所在服务器ip
     */
    @Value("${samba.ip:0.0.0.0}")
    private String ip;
    /**
     * 访问用户
     */
    @Value("${samba.username:root}")
    private String username;
    /**
     * 访问密码
     */
    @Value("${samba.password:password}")
    private String password;

    @Bean
    public NtlmPasswordAuthentication getNtlmPasswordAuthentication() {
        return new NtlmPasswordAuthentication(ip, username, password);
    }
}
